package com.ruoyi.work.config;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;

import java.io.InputStream;

/**
 * pdf签名配置
 *
 * @author fengcheng
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Configuration
public class PdfSignatureConfig {

    /**
     * 证书输入流
     */
    private InputStream pathInputStream;

    /**
     * 证书路径
     */
    @Value("${pdf-signature.certificate.path}")
    private String path;

    /**
     * 密码
     */
    @Value("${pdf-signature.certificate.password}")
    private String password;

    /**
     * 签字者
     */
    @Value("${pdf-signature.info.name}")
    private String name;

    /**
     * 联系电话
     */
    @Value("${pdf-signature.info.phone}")
    private String phone;

    /**
     * 地点
     */
    @Value("${pdf-signature.info.place}")
    private String place;

    /**
     * 原因
     */
    @Value("${pdf-signature.info.cause}")
    private String cause;

    public PdfSignatureConfig(InputStream pathInputStream, String password, String name, String phone, String place, String cause) {
        this.pathInputStream = pathInputStream;
        this.password = password;
        this.name = name;
        this.phone = phone;
        this.place = place;
        this.cause = cause;
    }
}
